YUI.add('mainview', function (Y) {
	
	
    function MainView(config) {
    	MainView.superclass.constructor.apply(this, arguments);
    }
    
    
    MainView.NAME = 'mainview';
    

    Y.extend(MainView, Y.View, {
    	
    	container: Y.one('#' + MainView.NAME),

    	events: {
    		
    	},
    	    	
    	initializer: function () {
    		this.treeView = new Y.srcprojector.TreeView({model: this.model});
        	this.pageView = new Y.srcprojector.PageView({model: this.model});
        	
        	Y.on('windowresize', Y.bind(this.resizeView, this));
    	},
    	
    	render: function () {
    	    this.treeView.render();
    		//this.pageView.render();
    		this.resizeView.call(this);
    		return this;
    	},
    	
    	resizeView: function () {
    		var height = this.container.get('winHeight') - 20;
    		
    		this.treeView.container.setStyles({
                height: height + 'px'
            });
    		this.pageView.container.setStyles({
                height: height + 'px'
            });    		
    	}
    	    	
    });
    

    Y.namespace('srcprojector').MainView = MainView;
    

}, '0.1.0', {requires: ['view', 'event-resize', 'treeview']});